import { createSlice } from "@reduxjs/toolkit";
import {nanoid} from 'nanoid'

const personalSlice = createSlice({
  name: "personal",
  initialState: {
    value: [],
  },
  reducers: {
    createAddPersonalAction: (state, action) => {
      action.payload = {id:nanoid(), ...action.payload}
      state.value = [action.payload, ...state.value];
    },
  },
});

export const { createAddPersonalAction } = personalSlice.actions;

export default personalSlice.reducer